using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_DataSet_IpTransit_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.DataSet.IpTransit);

            field = type.GetField("ip", flag);
            app.RegisterCLRFieldGetter(field, get_ip_0);
            app.RegisterCLRFieldSetter(field, set_ip_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_ip_0, AssignFromStack_ip_0);
            field = type.GetField("port", flag);
            app.RegisterCLRFieldGetter(field, get_port_1);
            app.RegisterCLRFieldSetter(field, set_port_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_port_1, AssignFromStack_port_1);
            field = type.GetField("cmd", flag);
            app.RegisterCLRFieldGetter(field, get_cmd_2);
            app.RegisterCLRFieldSetter(field, set_cmd_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_cmd_2, AssignFromStack_cmd_2);
            field = type.GetField("cmdType", flag);
            app.RegisterCLRFieldGetter(field, get_cmdType_3);
            app.RegisterCLRFieldSetter(field, set_cmdType_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_cmdType_3, AssignFromStack_cmdType_3);
            field = type.GetField("error", flag);
            app.RegisterCLRFieldGetter(field, get_error_4);
            app.RegisterCLRFieldSetter(field, set_error_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_error_4, AssignFromStack_error_4);
            field = type.GetField("data", flag);
            app.RegisterCLRFieldGetter(field, get_data_5);
            app.RegisterCLRFieldSetter(field, set_data_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_data_5, AssignFromStack_data_5);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.DataSet.IpTransit());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.DataSet.IpTransit[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_ip_0(ref object o)
        {
            return ((huqiang.DataSet.IpTransit)o).ip;
        }

        static StackObject* CopyToStack_ip_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.DataSet.IpTransit)o).ip;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_ip_0(ref object o, object v)
        {
            ((huqiang.DataSet.IpTransit)o).ip = (System.Int32)v;
        }

        static StackObject* AssignFromStack_ip_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @ip = ptr_of_this_method->Value;
            ((huqiang.DataSet.IpTransit)o).ip = @ip;
            return ptr_of_this_method;
        }

        static object get_port_1(ref object o)
        {
            return ((huqiang.DataSet.IpTransit)o).port;
        }

        static StackObject* CopyToStack_port_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.DataSet.IpTransit)o).port;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_port_1(ref object o, object v)
        {
            ((huqiang.DataSet.IpTransit)o).port = (System.UInt16)v;
        }

        static StackObject* AssignFromStack_port_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.UInt16 @port = (ushort)ptr_of_this_method->Value;
            ((huqiang.DataSet.IpTransit)o).port = @port;
            return ptr_of_this_method;
        }

        static object get_cmd_2(ref object o)
        {
            return ((huqiang.DataSet.IpTransit)o).cmd;
        }

        static StackObject* CopyToStack_cmd_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.DataSet.IpTransit)o).cmd;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_cmd_2(ref object o, object v)
        {
            ((huqiang.DataSet.IpTransit)o).cmd = (System.UInt16)v;
        }

        static StackObject* AssignFromStack_cmd_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.UInt16 @cmd = (ushort)ptr_of_this_method->Value;
            ((huqiang.DataSet.IpTransit)o).cmd = @cmd;
            return ptr_of_this_method;
        }

        static object get_cmdType_3(ref object o)
        {
            return ((huqiang.DataSet.IpTransit)o).cmdType;
        }

        static StackObject* CopyToStack_cmdType_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.DataSet.IpTransit)o).cmdType;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_cmdType_3(ref object o, object v)
        {
            ((huqiang.DataSet.IpTransit)o).cmdType = (System.Byte)v;
        }

        static StackObject* AssignFromStack_cmdType_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Byte @cmdType = (byte)ptr_of_this_method->Value;
            ((huqiang.DataSet.IpTransit)o).cmdType = @cmdType;
            return ptr_of_this_method;
        }

        static object get_error_4(ref object o)
        {
            return ((huqiang.DataSet.IpTransit)o).error;
        }

        static StackObject* CopyToStack_error_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.DataSet.IpTransit)o).error;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_error_4(ref object o, object v)
        {
            ((huqiang.DataSet.IpTransit)o).error = (System.UInt16)v;
        }

        static StackObject* AssignFromStack_error_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.UInt16 @error = (ushort)ptr_of_this_method->Value;
            ((huqiang.DataSet.IpTransit)o).error = @error;
            return ptr_of_this_method;
        }

        static object get_data_5(ref object o)
        {
            return ((huqiang.DataSet.IpTransit)o).data;
        }

        static StackObject* CopyToStack_data_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.DataSet.IpTransit)o).data;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_data_5(ref object o, object v)
        {
            ((huqiang.DataSet.IpTransit)o).data = (System.Byte[])v;
        }

        static StackObject* AssignFromStack_data_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Byte[] @data = (System.Byte[])typeof(System.Byte[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.DataSet.IpTransit)o).data = @data;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.DataSet.IpTransit();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
